package com.cpit.qualitycontrol.dao;

import com.cpit.qualitycontrol.entity.WorkOrder;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by xxx on 2017/9/29.
 */
public interface WorkOrderCrudRepository extends JpaRepository<WorkOrder, Long> {

//    Page<WorkOrder> getAllByActProcInstIdIn(List<String> procInstIdList, Pageable pageable);

//    @Query("select w from WorkOrder w where w.workOrderId = ?1")
//    public WorkOrder findByWorkOrderId(Long workOrderId);

//    @Query("select new WorkOrder(w.workOrderName," +
//            "w.deviceId," +
//            "w.deviceTypeId," +
//            "dt.name," +
//            "w.constructionTeam," +
//            "w.constructionTeamName," +
//            "w.state," +
//            "w.progress," +
//            "w.createTime," +
//            "w.assignTime," +
//            "w.endTime," +
//            "w.duration," +
//            "w.updateTime," +
//            "w.description," +
//            "w.actProcInstId) from WorkOrder w,DeviceType dt " +
//            "where w.workOrderId = ?1 and w.deviceTypeId = dt.id")
//    public WorkOrder findByJoinWorkOrder(Long workOrderId);
      List<WorkOrder> findByDeviceId(String deviceId);
}
